<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="http://api.mapabc.com/fmp/v1.0/js/fmp.js?key=d9026b1f289933f5c6312d30df7b9841a71a3e2eb5266aacb8babbd753b1595d3aa8631ddbb4656e" type="text/javascript">
</script>
<title>示例代码</title>
</head>
<body>
<div id="mapObj" class="view" style="width:1000px;height:500px"></div> 
<SCRIPT LANGUAGE="JavaScript">
  //设置中心点为北京
  var city_center_index="fjtekqrposNKGE,hrlphplnJOOE";
  //设置地图初始化参数对象
  var mapOptions = new MMapOptions();
  mapOptions.mapId = "fmptest";
  mapOptions.zoomLevel = 10;
  mapOptions.center = new MLatLng(city_center_index);
  //创建地图对象
  var mapObj = new MMap("mapObj", mapOptions);
  mapObj.showNavigator(true);
  //注册地图初始化完成事件 地图初始化完执行 mapInited() 方法
mapObj.addEventListener(MMap.EVENT_MAP_INITIALIZED, mapInited);

//注册鼠标画点后事件
mapObj.addEventListener(MMap.EVENT_POINT_DRAWN, pointDrawn);

var polylineStyle = new MStyle();
polylineStyle.lineColor = 0xff0000;
polylineStyle.lineSize = 5;
var polyline = new MPolylineOverlay([new MLatLng("qqhrqjgojKHEJ", "oipgkglllgOLIJ"),
new MLatLng("qqhrqfhohODMF","oipgkgmgljOLIJ"), 
new MLatLng("qqhrplmojOLMJ","oipgkgmihkGHIN")],polylineStyle, "1001"); 

function mapInited(){
//alert("初始化完成,请在地图上加点!");
//beginDrawPointOnMap();
}

function beginDrawPointOnMap()
{
var pointStyle = new MStyle();
pointStyle.lineColor = 0x445599;
pointStyle.lineSize = 3;
pointStyle.fillColor = 0xaa9900;
pointStyle.fillOpacity = 30;
pointStyle.label = "一个点";
pointStyle.textContent = "鼠标画点";
mapObj.beginDrawPointOnMap(pointStyle);
}

function pointDrawn(event)
{
alert(event.args[2]);
document.getElementById('mapinfo').value=event.args;
mapObj.quitMouseDraw();
}
</script>
<p><a href="javascript:void(0);" onclick="javascript:beginDrawPointOnMap()">添加标注</a>: 标注点参数:<input type="text" name="mapinfo" id="mapinfo" /><p>
</body>
</html>